listview: Change anchor handling again
authorBenjamin Otte <otte@redhat.com>
Mon, 24 Sep 2018 22:16:27 +0000 (00:16 +0200)
committerMatthias Clasen <mclasen@redhat.com>
Sat, 30 May 2020 23:26:45 +0000 (19:26 -0400)
commit2ba2a216cabae74d26ad445a580ac1b151d34b41
treea3db61f9cfab50ef443ee7b86fc2836afdc6e477
parente5add36a17cb64e6b300830f037d373bb8c0e031
listview: Change anchor handling again

The anchor is now a tuple of { listitem, align }.

Using the actual list item allows keeping the anchor across changes
in position (ie when lists get resorted) while still being able to fall
back to positions (list items store their position) when an item gets
removed.

The align value is in the range [0..1] and defines where in the visible
area to do the alignment.
0.0 means to align the top of the row with the top of the visible area,
1.0 aligns the bottom of the widget with the visible area and 0.5 keeps
the center of the widget at the center of the visible area.
It works conceptually the same as percentages in CSS background-position
(where the background area and the background image's size are matched
the same way) or CSS transform-origin.
gtk/gtklistitemmanager.c
gtk/gtklistitemmanagerprivate.h
gtk/gtklistview.c